The Extended Functions Request Type
Use the extended functions request to extend the interface provided in the standard image or sequence dialog boxes. You may specify a filter function, a hook function, and a custom button; you may retrieve the current settings for these options using the
SCGetInfo
function.
You supply a pointer to an extended functions structure. If you are retrieving these settings, the standard dialog component places the current settings into the specified structure; if you are changing the settings, place the new values into the structure--the component uses those values to update its settings. Set this pointer to
nil
to remove the current functions.
By default, none of these extended interface elements are used.
The
SCExtendedProcs
data type defines the format and content of the extended functions structure:
typedef struct {
SCModalFilterProcPtr filterProc; /* filter function */
SCModalHookProcPtr hookProc; /* hook function */
long refcon; /* reference constant */
Str31 customName; /* custom button name */
} SCExtendedProcs;
-
filterProc
-
Contains a pointer to a modal-dialog filter function in your application. Because the compression dialog box is a movable modal dialog box, you must provide a filter to process update events for your application windows. The standard component calls your filter function before it processes the event. You can use this function to control events in the dialog box. For example, you might use the filter function to release processing time to other windows displayed by your application while the standard image-compression dialog box is being displayed.
-
This is how to declare a filter function named
MyFilter
:
pascal Boolean MyFilter (DialogPtr theDialog,
EventRecord *theEvent, short *itemHit,
long refcon);
-
The operation of modal-dialog filter functions is described in the chapter "Dialog Manager" in
Inside Macintosh: Macintosh Toolbox Essentials
. The
refcon
parameter contains the reference constant you supply in the
refcon
field of this structure.
-
If you do not want to specify a filter function, set this parameter to
nil
.
-
hookProc
-
Contains a pointer to a dialog hook function in your application. The standard component calls your hook function whenever the user selects an item in the dialog box. You can use this function to customize the operation of the standard image-compression dialog box. For example, you might want to support a custom button that activates a secondary dialog box. Another possibility would be to provide additional validation support when the user clicks OK. For an example of defining a custom button, see
"Extending the Basic Dialog Box,"
.
-
This is how to declare a hook function named
MyHook
:
pascal short MyHook (DialogPtr theDialog,
short *itemHit, SCParams *params,
long refcon);
-
The operation of this dialog hook function is described in
"Application-Defined Function,"
beginning on
Application-Defined Function
.
-
If you do not want to specify a hook function, set this parameter to
nil
.
-
refcon
-
Specifies a reference constant that is to be passed to the dialog hook function and the modal-dialog filter function.
-
customName
-
Specifies the string to be displayed in the custom button in the dialog box.
-
If you are not using a custom button, set this parameter to
nil
.
© 1997 Apple Computer, Inc.Previous | Chapter Top | Chapter Contents | Next